const MyPromise = require ('./MyPromise');

let promise = new MyPromise((resolve, reject) => {
  setTimeout(() => {
    resolve('success');
    // reject('resson11');
  },2000)
  // reject('Error');
  // throw new Error('Exception: Error');
})

promise.then((value) => {
  console.log('1'+value);
}, (reason) => {
  console.log('1'+reason);
})

promise.then((value) => {
  console.log('2'+value);
}, (reason) => {
  console.log(1)
  console.log('2'+reason);
})

promise.then((value) => {
  console.log('3'+value);
}, (reason) => {
  console.log(1)
  console.log('3'+reason);
})

// fn = () => {console.log(1);}

// fn();